
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layuiAdmin 内容系统-分类管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../layuiadmin/style/admin.css" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-header layuiadmin-card-header-auto">
        <button class="layui-btn layuiadmin-btn-tags" id="add">添加</button>
		<button class="layui-btn layuiadmin-btn-tags layui-btn-danger" data-type="delete">删除</button>
      </div>
      <div class="layui-card-body">    
        <table id="LAY-app-content-tags" lay-filter="LAY-app-content-tags" class="layui-table">
			<thead>
				<tr>
				  <th type="checkbox"></th>
				  <th lay-data="{field:'id', sort: true}">ID</th>
				  <th lay-data="{field:'id', sort: true}">名称</th>
				  <th lay-data="{field:'author'}">内容</th>
				  <th lay-data="{field:'uploadtime', sort: true}">摘要</th>
				  <th lay-data="{field:'category'}">排序</th>
				  <th lay-data="{field:'status', sort: true}">SEO描述</th>
				  <th lay-data="{field:'status', sort: true}">SEO关键字</th>
				  <th>操作</th>
				</tr>
			  </thead>
        </table>  
        <script type="text/html" id="layuiadmin-app-cont-tagsbar">
          <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
          <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
        </script>
      </div>
    </div>
  </div>

  <script src="../layuiadmin/layui/layui.js"></script>
  <script>
layui.config({
    base: '../layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'table','layer','form'], function(){
    var $ = layui.$
    ,form = layui.form
    ,table = layui.table
	,layer = layui.layer;

	$(document).on('click', '#add', function() {
		layer.open({
		  type: 1,
		  area: '500px',
		  content: $('#addform') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
		});
	});


});
  </script>
</body>
<div id="addform" style="display:none" >
	<form class="layui-form" action="">
	  <div class="layui-form-item">
		<label class="layui-form-label">名称</label>
		<div class="layui-input-block">
		  <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
		</div>
	  </div>
	  <div class="layui-form-item layui-form-text">
		<label class="layui-form-label">内容</label>
		<div class="layui-input-block">
		  <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
		</div>
	  </div>  
	  <div class="layui-form-item layui-form-text">
		<label class="layui-form-label">摘要</label>
		<div class="layui-input-block">
		  <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
		</div>
	  </div>
	  <div class="layui-form-item">
		<label class="layui-form-label">排序</label>
		<div class="layui-input-block">
		  <input type="text" name="title" placeholder="请输入标题" autocomplete="off" class="layui-input">
		</div>
	  </div>
	  <div class="layui-form-item layui-form-text">
		<label class="layui-form-label">SEO描述</label>
		<div class="layui-input-block">
		  <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
		</div>
	  </div>
	  <div class="layui-form-item">
		<label class="layui-form-label">SEO关键字</label>
		<div class="layui-input-block">
		  <input type="text" name="title" placeholder="请输入标题" autocomplete="off" class="layui-input">
		</div>
	  </div>
	  <div class="layui-form-item">
		<div class="layui-input-block">
		  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
		  <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	  </div>
	</form>
 
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  
  //监听提交
  form.on('submit(formDemo)', function(data){
    
    return false;
  });
});
</script>
</div>
</html>
